<template>
	<view>
		<u-navbar leftText="用药清单" :safeAreaInsetTop="false" :autoBack='true'>
			<!-- 	<view class="u-nav-slot" slot="left">
				<u-icon name="arrow-left" size="19"></u-icon>
				<u-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
				<u-icon name="home" size="20"></u-icon>
			</view> -->
		</u-navbar>
		<view style="width: 100%; height: 85rpx;"></view>
		<view>
			<view style="border-top: 2rpx solid #cecece;
			padding: 10rpx;" v-for="(item,index) in arrays" :key="index">
				<view class="flx" style="width: 90%; margin:0 auto;">
					<view class="flx1">
						<view class="flxAlign">
							<view style="width: 200rpx; height: 150rpx;">
								<image style="width: 100%; height: 100%;" src="/static/images/huanglian.png"></image>
							</view>
						</view>
						<view style="margin-left: 30rpx;">
							<view class="luohuo">{{item.name}}</view>
							<view class="luohuo">{{item.text}}</view>
							<view class="luohuo">{{item.gsname}}</view>
						</view>
					</view>
					<view style="margin-top:10rpx;">
						<u-icon name="trash" size="35rpx" @click="shanchu(index)"></u-icon>
					</view>
				</view>
				<view class="flx1" style="width: 90%; margin:0 auto; margin-top:80rpx;">
					<view>数量</view>
					<u-number-box style="margin-left: 100rpx;" v-model="item.number" :disabled="true">
						<view slot="minus" class="plus">
							<u-icon name="minus" color="#FFFFFF" size="12"></u-icon>
						</view>
						<text slot="input" style="width: 50px;text-align: center;" class="input">{{value}}</text>
						<view slot="plus" class="plus">
							<u-icon name="plus" color="#FFFFFF" size="12"></u-icon>
						</view>
					</u-number-box>
				</view>
				<view style="width: 90%; height: 20rpx; margin:0 auto;"></view>
			</view>
		</view>
		<!--  -->
		<view>
			<view style="text-align: center; margin-top: 80rpx;" @click="tjyp"> <span style="font-size: 35rpx;"> + </span><span>添加药品</span></view>
		</view>
		<view @click="quer"
			style="width: 90%; background-color: #0079fe; color: #fff; font-size: 25rpx; text-align: center; height: 80rpx; line-height: 80rpx; margin-left: 5%; margin-top:100rpx;">
			下一步
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				value: 1,
				pl: '',
				text: '',
				pls: '',
				plfa: '',
				plts: '',
				arrays: [{
						number: 1,
						name: '络活喜 苯横酸氨氯地平片',
						text: '5mg*7片/盒',
						gsname: '辉瑞制药有限公司'
					},
					{
						number: 1,
						name: '络活喜 苯横酸氨氯地平片',
						text: '5mg*7片/盒',
						gsname: '辉瑞制药有限公司'
					},
					{number:1,
					name:'络活喜 苯横酸氨氯地平片',
					text:'5mg*7片/盒',
					gsname:'辉瑞制药有限公司'}
				]
			}
		},
		onLoad(e){
			if(e.object){
				this.arrays.push(JSON.parse(e.object))
			}
		
		},
	methods:{
		quer() {
			uni.navigateTo({
				url:'/pages/OnlineConsultation/dzcf'
			})
		},
		shanchu(index){
			console.log(index);
			this.arrays.splice(index,1)
		},
		tjyp(){
			uni.navigateTo({
				url:'/pages/OnlineConsultation/yyjy'
			})
		}
	}
	}
</script>

<style lang="scss">
	.minus {
		width: 22px;
		height: 22px;
		border-width: 1px;
		border-color: #E6E6E6;
		border-style: solid;
		border-top-left-radius: 100px;
		border-top-right-radius: 100px;
		border-bottom-left-radius: 100px;
		border-bottom-right-radius: 100px;
		@include flex;
		justify-content: center;
		align-items: center;
	}

	.input {
		padding: 0 10px;
	}

	.plus {
		width: 22px;
		height: 22px;
		background-color: #cecece;
		border-radius: 50%;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		justify-content: center;
		align-items: center;
	}

	.luohuo {
		font-size: 25rpx;
		line-height: 50rpx;
	}
</style>